#ifndef GLOBAL_H
#define GLOBAL_H

#include <QtCore/QSharedDataPointer>
#include <QtCore/QDateTime>
#include "smpp/parameters/smpp_prameters_header.h"
#include "smpp/parameters/smpp_prameters_mandatory.h"
#include "smpp/sessions/smpp_client_async_session.h"
#include "smpp/sessions/smpp_server_async_session.h"
#include "qtjsonsettings/qtjsonsettings.h"
#include "logmanager/log_manager.h"

#ifdef Q_OS_UNIX
static const char LOG_FILE_PATH[]       = "/var/log";
static const char PID_FILE[]            = "/var/run/smstranslator.pid";
static const char DEFAULT_CONFIG_PATH[] =
  "/usr/local/etc/smstranslator/config.json";
static const char DEFAULT_COUNTER_PATH[] =
  "/usr/local/etc/smstranslator/counter.json";
#else
static const char LOG_FILE_PATH[]       = "./";
static const char DEFAULT_CONFIG_PATH[] = "config.json";
static const char DEFAULT_COUNTER_PATH[] = "counter.json";
#endif
static const char APP_NAME[]            = "smstranslator";
static const char APP_VERSION[]         = "1.0.0";
static const QString APP_NAME_VERSION   =
  QString("%1 %2").arg(APP_NAME).arg(APP_VERSION);
static const char HELP[]                =
"  [OPTION]...\n"
"Options:\n"
"    -help | -h       Display this help\n"
"    -version | -v    Display program version\n"
"    -config <path>   Override the default path where user config are stored";

static const char HELP_OPTION1[]        = "-h";
static const char HELP_OPTION2[]        = "-help";
static const char VERSION_OPTION1[]     = "-v";
static const char VERSION_OPTION2[]     = "-version";
static const char CONFIG_OPTION[]       = "-config";

static const char UNIX_DAEMON_CLS[]     = "UnixDaemon";
static const int  UNIX_DAEMON_ID        = 1;

static const char KERNEL_CLS[]          = "Kernel";
static const int  KERNEL_ID             = 2;

static const char SERVER_KEY[]          = "server";
static const char LOG_LEVEL_KEY[]       = "log_level";
static const char LISTEN_HOST_KEY[]     = "listen_host";
static const char LISTEN_PORT_KEY[]     = "listen_port";
static const char SMSC_HOST_KEY[]       = "smsc_host";
static const char SMSC_PORT_KEY[]       = "smsc_port";
static const char STAT_FILE_KEY[]       = "stat_file";
static const char ZABBIX_IP_KEY[]       = "zabbix_ip";
static const char ZABBIX_PORT_KEY[]     = "zabbix_port";
static const char ZABBIX_TIMEOUT_KEY[]  = "zabbix_timeout";
static const char CLIENTS_KEY[]         = "clients";
static const char ACCESS_IP_KEY[]       = "access_ip";
static const char ACCESS_SID_KEY[]      = "access_sid";
static const char MAX_IN_SPEED_KEY[]    = "max_in_speed";
static const char MAX_OUT_SPEED_KEY[]   = "max_out_speed";
static const char MAX_IN_TRANS_KEY[]    = "max_in_trans";
static const char MAX_OUT_TRANS_KEY[]   = "max_out_trans";

static const char CHANGE_SRC_ADDR_KEY[] = "change_source_addr";
static const char DEST_ADDR_KEY[]       = "dest_addr";
static const char ADDR_BEFORE_KEY[]     = "addr_before";
static const char TON_BEFORE_KEY[]      = "ton_before";
static const char NPI_BEFORE_KEY[]      = "npi_before";
static const char ADDR_AFTER_KEY[]      = "addr_after";
static const char TON_AFTER_KEY[]       = "ton_after";
static const char NPI_AFTER_KEY[]       = "npi_after";

static const char NOT_FOUND_KEY_1[] = "Config parse error! Not found key '%1'!";
static const char NOT_FOUND_KEY_1_2[] =
  "Config parse error! Not found key '%1/%2'!";
static const char NOT_FOUND_KEY_1_2_3[] =
  "Config parse error! Not found key '%1[%2]/%3'!";
static const char PARSE_ERROR_1[] =
  "Config parse error! Impossible parse key '%1'!";
static const char PARSE_ERROR_1_2_3[] =
  "Config parse error! Impossible parse key '%1[%2]/%3'!";

static const int DEF_IN_TRANSACTIONS   = 10000;
static const int DEF_OUT_TRANSACTIONS  = 10000;
static const int DEF_MAX_IN_SPEED      = 5;   // sms / sec
static const int DEF_MAX_OUT_SPEED     = 5;   // sms / sec
static const int DEF_SESSION_INIT_TIME = 60;  // sec
static const int DEF_ENQUIRE_LINK_TIME = -1;  // sec
static const int DEF_INACTIVITY_TIME   = 60;  // sec
static const int DEF_TRANSACTION_TIME  = 60;  // sec

namespace smstranslator {
  enum State {
    STARTED,
    STARTING,
    STOPING,
    STOPED
  };
} // namespace smstranslator

#endif // GLOBAL_H
